// snoabbdom 测试代码
// import {  init,
//           classModule,
//           propsModule,
//           styleModule,
//           eventListenersModule
// } from "snabbdom"
import  h  from "./h.js"
// const patch = init([
//   classModule,
//   propsModule,
//   styleModule,
//   eventListenersModule
// ])
import patch from "./patch"
const container = document.getElementById("container")
const vnode = h('ul',{key:"ul"},[
  h('li',{key:"a"},"a"),
  h('li',{key:"b"},"b"),
  h('li',{key:"c"},"c"),
  h('li',{key:"d"},"d")
])
patch(container,vnode)
// 更新的新dom
const newVnode = h("ul",{key:'ul'},[
  h('li',{key:"n"},"n"),
  h('li',{key:"1"},"1"),
  h('li',{key:"2"},"2"),
  h('li',{key:"a"},"a"),
  h('li',{key:"c"},"c"),
  h('li',{key:"b"},"b"),
  h('li',{key:"q"},"q"),
  h('li',{key:"w"},"w"),


])
const btn = document.getElementById("btn")
btn.innerText="点击更换数据!"
btn.addEventListener("click",updata)
function updata(){
  patch(vnode,newVnode)
}
